# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=libwpe
pkgver=1.12.0
pkgrel=1
pkgdesc="General-purpose library specifically developed for the WPE-flavored port of WebKit"
url="https://wpewebkit.org/"
arch="all"
license="BSD-2-Clause"
makedepends="cmake mesa-dev libxkbcommon-dev samurai"
options="!check" # no tests
subpackages="$pkgname-dev $pkgname-dbg"
source="https://github.com/WebPlatformForEmbedded/libwpe/releases/download/$pkgver/libwpe-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		$CMAKE_CROSSOPTS
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d85865fd6f2dd907589a4d2c1b956d9a2093f72f5b7f755ab2bef040f7f26a73ddadd47a607a78578dec6eb6d59f44e18fa8b96a71f7bd19f3d62073f3ca6fee  libwpe-1.12.0.tar.xz
"
